package com.sikaryofficial.workbench.constant;

import lombok.Getter;

/**
 * @author : wuweihong
 * @desc : 会员激励政策状态枚举
 * @date : 2024-10-20
 */

@Getter
public enum MembershipPolicyEnum {
	OUT_LIST(0, "未激活"),
	IN_LIST(1, "激活")
	;

	private int code;
	private String desc;

	private MembershipPolicyEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	/**
	 * 根据code获取会员激励政策枚举
	 */
	public static MembershipPolicyEnum getByCode(int code) {
		for (MembershipPolicyEnum item : MembershipPolicyEnum.values()) {
			if (item.getCode() == code) {
				return item;
			}
		}
		return null;
	}

}
